package com.kuangstudy.thread.demo1;

/**
 * ClassName: Demo3
 * date: 2021/07/17 23:20:27
 *创建线程方法2 实现runnable方法
 * @author zlk
 */
public class Demo3 implements Runnable{
    @Override
    public void run() {
        //run方法线程体
        for (int i = 0; i < 20; i++) {
            System.out.println("我在看代码----"+i);
        }
    }

    public static void main(String[] args) {
        Demo3 demo3 = new Demo3();
        Thread thread = new Thread(demo3);
        thread.start();
        for (int i = 0; i < 50; i++) {
            System.out.println("我在学习"+i);
        }
    }
}
